<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<!-- 查询框开始 -->
<div class="table-responsive">
<form class="form-inline" method="GET" action="<?php echo $this->input->server('REQUEST_URI'); ?>" name="queryForm" id="queryForm">
<input type="hidden" name="c" id="c" value="<?php echo $this->input->get('c') ?>">
<input type="hidden" name="m" id="m" value="<?php echo $this->input->get('m') ?>">
  <div class="form-group">
    <label for="year">所属年份：</label>
    <select class="form-control" id="year" name="year">
      <option value="">请选择</option>
    </select>
  </div>
 <div class="form-group">
  <button type="submit" class="btn btn-default btn-primary">查询</button>
  </div>
</form>
</div>
<div class="" style="margin-top: 10px;">
  <table class="table table-hover table-bordered">
    <thead>
      <tr>
        <th class="bg-primary text-center">所属双月</th>
        <th class="bg-primary text-center">车展广宣活动预算费用</th>
        <th class="bg-primary text-center">车展场租预算费用</th>
        <th class="bg-primary text-center">车展配套预算费用</th>
        <th class="bg-primary text-center">计划申请总费用</th>
        <th class="bg-primary text-center">操作</th>
      </tr>
    </thead>
    <tbody>
    <?php
    foreach ($timeUnitList as $timeK => $timeV) {
    	$procData = isset($procList[$timeK]) ? $procList[$timeK] : array('year'=>$year,'timeUnit'=>$timeK,'storeId'=>$this->user['userId']);
    ?>
      <tr>
        <td class="text-center"><?php echo $timeV; ?></td>
        <td class="text-center"><?php echo isset($procList[$timeK]) ? (float)$procList[$timeK]['budgetApplyGx'] : '';?></td>
        <td class="text-center"><?php echo isset($procList[$timeK]) ? (float)$procList[$timeK]['budgetApplyRent'] : '';?></td>
        <td class="text-center"><?php echo isset($procList[$timeK]) ? (float)$procList[$timeK]['budgetApplyMatching'] : '';?></td>
        <td class="text-center"><?php echo isset($procList[$timeK]) ? (float)$procList[$timeK]['budgetApply'] : '';?></td>
        <td class="text-center">
        	<?php if ($this->auth->isCarBudgetAdd($procData)) {?>
        	<a class="btn btn-default btn-sm buttona" role="button" href="<?php echo printUrl('CarBudget','storeAdd', $procData); ?>">计划申请</a><br>
        	<?php } ?>
        	<?php if ($this->auth->isCarBudgetEdit($procData)) {?>
        	<a class="btn btn-default btn-sm buttona" role="button" href="<?php echo printUrl('CarBudget','storeEdit', array('procId'=>$procData['id'])); ?>">计划修改</a><br>
        	<?php } ?>
        	<?php if ($this->auth->isCarBudgetCheck($procData)) {?>
        	<a class="btn btn-default btn-sm buttona" role="button" href="<?php echo printUrl('CarBudget','check', array('procId'=>$procData['id'])); ?>">计划查看</a>
        	<?php } ?>
        </td>
      </tr>
    <?php } ?>
    </tbody>
  </table>
</div>
<script type="text/javascript">
  $(function(){
    loadYearList('year',<?=$year?>);
  });
</script>
<?php $this->load->view('common/foot');?>